<script type="text/javascript">
    $(document).ready(function()
    {
        $("select, input").uniform();
    });
</script>
<?php
    function __autoload($class_name)
	{
		include_once('../classes/'.strtolower($class_name).'.php');
	}
    
    if(isset($_POST['MaLoaiSanPhamCap1']))
        $MaLoaiSanPhamCap1 = $_POST['MaLoaiSanPhamCap1'];
    else
        $MaLoaiSanPhamCap1 = 0;
        
    if(isset($_POST['MaLoaiSanPhamCap2']))
        $MaLoaiSanPhamCap2 = $_POST['MaLoaiSanPhamCap2'];
    else
        $MaLoaiSanPhamCap2 = 0;
        
    if(isset($_POST['MaLoaiSanPhamCap3']))
        $MaLoaiSanPhamCap3 = $_POST['MaLoaiSanPhamCap3'];
    else
        $MaLoaiSanPhamCap3 = 0;
        
    $MaLoaiSanPham = 0;
    
    $loaisanpham = new loaisanphambs();
    $ret_loaisanpham = $loaisanpham->getList();
    
    $loaisanpham->MaLoaiSanPhamCap1 = $MaLoaiSanPhamCap1;
    $loaisanpham->MaLoaiSanPhamCap2 = $MaLoaiSanPhamCap2;
    $loaisanpham->MaLoaiSanPhamCap3 = $MaLoaiSanPhamCap3;
    
    $ret_loaisanpham_id = $loaisanpham->getIds();
    $MaLoaiSanPham = $ret_loaisanpham_id[0]['MaLoaiSanPham'];
    
	echo '<select name="MaLoaiSanPham" id="MaLoaiSanPham" onchange="onchangeStyleProduct();">';
	for($i = 0; $i < ($ret_loaisanpham != false ? count($ret_loaisanpham) : 0); $i++)
	{
        $selected = '';
        if($ret_loaisanpham[$i]['MaLoaiSanPham'] == $MaLoaiSanPham)
            $selected = "selected = selected";
		echo "<option {$selected} value=\"{$ret_loaisanpham[$i]['MaLoaiSanPham']}\">{$ret_loaisanpham[$i]['TenLoaiSanPham']}</option>";
	}
    echo '</select>';
?>